package com.ofood.springcloud.domain;

import com.ofood.springcloud.utils.DateTimeUtils;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.format.annotation.DateTimeFormat;

import java.io.Serializable;
import java.math.BigDecimal;
import java.time.LocalDateTime;

@Data
@NoArgsConstructor
@AllArgsConstructor
public class Food implements Serializable {
    private Integer id;
    private String foodName;
    private String foodUrl;
    private String foodAttachment;
    private String foodDescription;
    private BigDecimal foodPrice;
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm")
    private LocalDateTime foodMfg;
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm")
    private LocalDateTime foodExp;
    private LocalDateTime foodCreated;
    private LocalDateTime foodUpdated;
    private String foodExpStr;
    private String foodMfgStr;

    public String getFoodExpStr() {
        return DateTimeUtils.convertLocalTimeToString(foodExp);
    }

    public void setFoodExpStr(String foodExpStr) {
        this.foodExpStr = foodExpStr;
    }

    public String getFoodMfgStr() {
        return DateTimeUtils.convertLocalTimeToString(foodMfg);
    }

    public void setFoodMfgStr(String foodMfgStr) {
        this.foodMfgStr = foodMfgStr;
    }
}
